import request from '@/utils/request'


export function getMenuList() {
  return request({
    url: '/app/getAppAdminPowerList',
    method: 'get'
  })
}
export function getMenu(id) {
  return request({
    url: `/app/getAppAdminPowerInfo?id=${id}`,
    method: 'get'
  })
}

export function addMenu(data) {
  return request({
    url: '/app/addAppAdminPower',
    method: 'post',
    data
  })
}

export function updateMenu(data) {
  return request({
    url: `/app/updateAppAdminPower`,
    method: 'post',
    data
  })
}

export function deleteMenu(data) {
  return request({
    url: `/app/deleteAppAdminPower`,
    method: 'post',
    data
  })
}



export function getAllPower() {
  return request({
    url: '/app/getAllPower',
    method: 'get'
  })
}
export function getRoleList() {
  return request({
    url: '/app/getAppAdminRoleList',
    method: 'get'
  })
}
export function getRole(id) {
  return request({
    url: `/app/getAppAdminRoleInfo?id=${id}`,
    method: 'get'
  })
}

export function addRole(data) {
  return request({
    url: '/app/addAppAdminRole',
    method: 'post',
    data
  })
}

export function updateRole(data) {
  return request({
    url: `/app/updateAppAdminRole`,
    method: 'post',
    data
  })
}

export function deleteRole(data) {
  return request({
    url: `/app/deleteAppAdminRole`,
    method: 'post',
    data
  })
}


export function getAdminList(params) {
  return request({
    url: '/app/getAdminUserList',
    method: 'get',
    params
  })
}
export function getAdmin(id) {
  return request({
    url: `/app/getAdminUserInfo?id=${id}`,
    method: 'get'
  })
}

export function addAdmin(data) {
  return request({
    url: '/app/addAdminUser',
    method: 'post',
    data
  })
}

export function updateAdmin(data) {
  return request({
    url: `/app/updateAdminUser`,
    method: 'post',
    data
  })
}

export function deleteAdmin(data) {
  return request({
    url: `/app/deleteAdminUser`,
    method: 'post',
    data
  })
}
export function updateAdminPassword(data) {
  return request({
    url: `/app/updateAdminPassword`,
    method: 'post',
    data
  })
}
export function resetAdminPassword(data) {
  return request({
    url: `/app/resetAdminPassword`,
    method: 'post',
    data
  })
}
